<?php if(!defined('HDWIKI_ROOT')) exit('Access Denied');?>
<?php include $this->gettpl('admin_header');?>
<script type="text/javascript">
function randomAuthKey(){
	var pwchars = "abcdefhjmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUVWYXZ";
	var passwordlength = 20;    // do we want that to be dynamic?  no, keep it simple :)
	var passwd='';
	for ( i = 0; i < passwordlength; i++ ){
		passwd += pwchars.charAt( Math.floor( Math.random() * pwchars.length ) )
	}
	document.getElementById('authKey').value = passwd;
	return passwd;
}

</script>
<p class="map">全局：扩展设置</p>
<p class="sec_nav">扩展设置：
    <a href="index.php?admin_setting-sec" > <span>防灌水设置</span></a>
    <a href="index.php?admin_setting-anticopy"><span>防采集设置</span></a>
    <a href="index.php?admin_setting-mail"><span>邮件设置</span></a>
    <a href="index.php?admin_setting-noticemail"><span>邮件提醒设置</span></a>
    <a href="index.php?admin_banned" ><span>IP禁止</span></a>
    <a href="index.php?admin_setting-passport"  class="on"><span>通行证设置</span></a>
    <a href="index.php?admin_setting-ucenter"><span>UCenter设置</span></a>
    <a href="index.php?admin_setting-ldap"><span>LDAP设置</span></a>
</p><h3 class="col-h3">通行证设置</h3>
<ul class="col-ul tips">
	<li class="bold">提示：</li>
	<li>如果您安装了UCenter插件，需要把UC插件停用。</li>
</ul>
<form action="index.php?admin_setting-passport" method="post">
	<table class="table">
	<tr>
		<td width="100px"><span>开启通行证:</span></td>
		<td>
		<input name="ppopen" type="radio" value="1" <?php if($pp_open == "1") { ?>checked="checked"<?php } ?>/> 
		是   <input name="ppopen" type="radio" value="0" <?php if($pp_open != "1") { ?>checked="checked"<?php } ?>/> 否</td>
	</tr>
	<tr>
		<td ><span>通行证类型:</span></td>
		<td>
			<input name="ppname" type="radio" value="PHPCMS" <?php if($pp_name == "PHPCMS") { ?>checked="checked"<?php } ?>/>PHPCMS
			<input name="ppname" type="radio" value="DEDECMS" <?php if($pp_name == "DEDECMS") { ?>checked="checked"<?php } ?>/> DEDECMS
			<input name="ppname" type="radio" value="PHPWIND" <?php if($pp_name == "PHPWIND") { ?>checked="checked"<?php } ?>/> PHPWIND 
		</td>
	</tr>
	<tr>
		<td ><span>通行证方式:</span></td>
		<td>
		<select name="pptype" onChange="if(this.value=='client'){document.getElementById('ppclient').style.display = '';}else{document.getElementById('ppclient').style.display = 'none';}">
			<option value="server" <?php if($pp_type != "client") { ?>selected="selected"<?php } ?>> 服务端(server)</option>
			<option value="client" <?php if($pp_type == "client") { ?>selected="selected"<?php } ?>> 客户端(client)</option>
		</select></td>
	</tr>
	<tr>
		<td ><span>通行证密钥:</span></td>
		<td><input id="authKey" type="text" class="inp_txt" name="ppkey" value="<?php echo $pp_key?>" />  <a href="#" onClick="javascript:randomAuthKey();" class="sgbtn"><font color="#FF0000">生成一个KEY</font></a></td>
	</tr>
	<tr>
		<td ><span>连接程序地址:</span></td>
		<td><input type="text" class="inp_txt" name="ppapi" value="<?php echo $pp_api?>" />
			填你要整合的网站/论坛地址,以http开头,后不要接"/"，如：http://www.xxxxx.com/bbs。</td>
	</tr>
	</table>
	<table class="table" id="ppclient" <?php if($pp_type != "client") { ?>style="display:none;"<?php } ?>>
		<tr>
			<td width="100px"><span>会员注册地址:</span></td>
			<td>
			<input type="text" class="txt" name="ppreg" value="<?php echo $pp_reg?>" />
			填写会员注册的地址如:/register.php,注意,没有http开头。</td>
		</tr>
		<tr>
			<td ><span>会员登录地址:</span></td>
			<td>
			<input type="text" class="txt" name="pplogin" value="<?php echo $pp_login?>" />
			填写会员登录的地址如:/logging.php?action=login。</td>
		</tr>
		<tr>
			<td ><span>会员退出的地址:</span></td>
			<td>
			<input type="text" class="txt" name="pplogout" value="<?php echo $pp_logout?>" />	
			填写会员退出的地址如:/logging.php?action=logout。</td>
		</tr>
	</table>
	<table class="table">
		<tr>
			<td colspan="2"><input type="submit" name="passport" value=" 提 交 " class="inp_btn" tabindex="3" /></td>
		</tr>
	</table>
</form>
<?php include $this->gettpl('admin_footer');?>